<template>
	<view>
		<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button" active-color="#434343"></uni-segmented-control>
		<view class="content">
			<view v-show="current === 0">
				这是好友列表的页面
			</view>
			<view v-show="current === 1">
				这是消息列表页面
			</view>
			<view v-show="current === 2">
				这是系统通知页面
			</view>
		</view>
	</view>
</template>

<script>
	import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
	export default {
		components: {
			uniSegmentedControl
		},
		data() {
			return {
				items: ['好友', '消息', '通知'],
				current: 0
			}
		},
		onLoad() {

		},
		methods: {
			onClickItem(index) {
				if (this.current !== index) {
					this.current = index;
				}
				let titles=this.$data.items[this.current]
				uni.setNavigationBarTitle({
					title:titles
				});
			}
		}
	}
</script>

<style>
</style>
